<#include "/@inc/funcMacros.ftl">

<#--  Function Macros for IDL file -->

<#--  Adds a tk_xxx attribue Get/Set functions DECLaration
IDL function
#pragma PROPERTY Point1
    HRESULT get_Point1(out /*IDLRETVAL*/ CATIAReference opiReferenceOnPoint1);
    HRESULT put_Point1(in CATIAReference ipiReferenceOnPoint1);
 * @param attr
 *  attribute data type with {name, type, facet } info}
-->
<#macro IDL_GET_FUNC_DECL_COMMON  attr clsName="" fqual="" ftype ="">
<#list Types as x>
<#if ( attr.type?length == 0 ) >
	 /**
	 * ${clsName}${attr.name}
	 * S_OK if successfull else E_FAIL.
	 */
	HRESULT ${clsName}${attr.name}() ${ ftype}
<#break>
<#elseif x.tk_type == attr.type>
	 /**
	 * ${clsName}Get${attr.name}
	 * @param o${x.prefix}${attr.name}
	 *
	 * @return S_OK if successfull else E_FAIL.
	 */
	  HRESULT ${clsName}get_${attr.name}( out /*IDLRETVAL*/ ${x.IDLtype}  o${x.prefix}${attr.name})  ${ ftype}
<#break></#if></#list>
</#macro>

<#--  Adds a tk_xxx attribue Set function DECLaration
 * @param attr
 *  attribute data type with {name, type, facet } info}
-->
<#macro IDL_SET_FUNC_DECL_COMMON  attr clsName="" fqual="" ftype ="">
<#list Types as x>
<#if x.tk_type == attr.type>
	 /**
	 * ${clsName}Set${attr.name}
	 * @param ${x.prefix}${attr.name}
	 *
	 * @return S_OK if successfull else E_FAIL.
	 */
	 HRESULT ${clsName}put_${attr.name}( in ${x.IDLtype}  ${x.IDLPrefix}${attr.name})  ${ ftype}
</#if></#list>
</#macro>

<#--  Adds a tk_xxx attribue Get/Set functions DECLaration
 * @param attr
 *  attribute data type with {name, type, facet } info}
-->
<#macro IDL_FUNC_DECL  attr clsName="" pvirtual ="n">

<#if ( attr.type?length > 0 ) >
#pragma PROPERTY ${attr.name}
</#if>
<@IDL_GET_FUNC_DECL_COMMON attr clsName  "" " ;" />
<@IDL_SET_FUNC_DECL_COMMON attr clsName  "" " ;" />
</#macro>

<#--  adds a tk_list(tk_xxx) attribue Get/Set functions DECLaration
 * @param attr
 *  LIST attribute data type with {name, type, facet } info}
-->
<#macro IDL_LIST_FUNC_DECL  attr clsName="", pvirtual ="n">
<#list ListTypes as t> <#if t.tk_type == attr.type> <#assign x = t> <#break></#if></#list>
	 /**
	 * ${clsName}Get${attr.name}
	 * @param o${x.prefix}${attr.name}
	 *
	 * @return  S_OK if successfull else E_FAIL.
	 */
	  HRESULT ${clsName}Get${attr.name}( out /*IDLRETVAL*/ CATSafeArrayVariant  o${x.prefix}${attr.name} ) ;

	 /**
	 * ${clsName}Set${attr.name}
	 * @param ${x.IDLPrefix}${attr.name}
	 *
	 * @return S_OK if successfull else E_FAIL.
	 */
	 HRESULT ${clsName}Set${attr.name}( in CATSafeArrayVariant  ${x.IDLPrefix}${attr.name}) ;

 <#if x.type == "CATListValCATISpecObject_var">
	 /**
	 * ${clsName}Add${attr.name}
	 * @param ipSpec${attr.name}
	 *
	 * @return  S_OK if successfull else E_FAIL.
	 */
	 HRESULT ${clsName}Add${attr.name}( in CATIAReference ipSpec${attr.name}) ;

	 /**
	 * ${clsName}Remove${attr.name}
	 * @param ipSpec${attr.name}
	 *
	 * @return  S_OK if successfull else E_FAIL.
	 */
	 HRESULT ${clsName}Remove${attr.name}( in CATIAReference ipSpec${attr.name}) ;
 </#if>
</#macro>

